﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace ExcelToXml
{
    public class Common
    {

        //    string strConn="provider=Microsoft.Jet.OLEDB.4.0;data source=你的Excel文件.xls; Extended Properties=Excel 8.0;";
        //    DataSet ds=new DataSet();
        //    System.Data.OleDb.OleDbConnection oleConn=new System.Data.OleDb.OleDbConnection(strConn);
        //    System.Data.OleDb.OleDbDataAdapter oleDa=new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]",oleConn);
        //    oleDa.Fill(ds,"INFO");
        //    foreach(DataRow row in ds.Tables["INFO"].Rows)
        //   {
        //    string userInfo=row[0].ToString().Trim();

        //}
        ////下面是把信息写入到xml中
        // //  DataSet ds=new DataSet();
        // //  oleDa.Fill(ds,"INFO"); //就是上面那个oleDads.WriteXml(文件名);
        //}
    }
}
